function [Wp, Wm, Qp, Qm] = WQ(x, z0, zc, p, nmax)
%WQ Summary of this function goes here
%   Detailed explanation goes here
    if nargin == 4
        nmax = 10;
    end
    
    [Wp_n, Wm_n, Qp_n, Qm_n] = arrayfun( @(n) WQ_n(x, z0, zc, n, p), -nmax:nmax);
    Wp = sum(Wp_n);
    Wm = sum(Wm_n);
    Qp = sum(Qp_n);
    Qm = sum(Qm_n);
end

